<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

class IntermediaryUser extends Model
{
    use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'intermediary_user';

    public function company()
    {
        return $this->belongsTo(Company::class, 'company');
    }

    public static function getBrokerList()
    {
        return self::limit(10)->get();
    }

    public static function getAllData()
    {
        $data = self::with('company')->get();
        if ($data){
           return $data->toArray();
        }
    }
}
